package practice.knowledge;
public class User {// 类名要见名知意
    private String username;// 成员变量用private修饰
    private String password;
    private String email;

    // 成员方法：提供每一个成员变量对应的setXxx()和getXxx()，还可能要写上其他行为
    // 选中private然后点小灯泡
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    // 两种构造方法
    public User() {/* 无参构造(需用到getter和setter) */
    }

    public User(String username, String password, String email) {/* 带全部参数的构造 */
        this.username = username;
        this.password = password;
        this.email = email;
    }
}